From: Bryan Davis Date: Fri, 30 Sep 2016 21:50:40 +0000 (-0600) Subject: MWExceptionHandler: Restore delegation to MWException::report X-Git-Tag: 1.31.0-rc.0~5257 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=74498116c0452db0f50c3b1c54817d254b065e4d;p=lhc%2Fweb%2Fwiklou.git MWExceptionHandler: Restore delegation to MWException::report Follow up to 00bee0297. Many MWException subclasses override MWException::report to do things like special logging and setting the HTTP response status code. We need to keep calling those methods until MWExceptionRenderer knows how to handle all of them. Bug: T147098 Change-Id: I2c90e2d9e9b019357458c7e14a3d602b591c6f5b --- diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 8359846a42..797b3af2f3 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -62,7 +62,15 @@ class MWExceptionHandler { protected static function report( $e ) { try { // Try and show the exception prettily, with the normal skin infrastructure - MWExceptionRenderer::output( $e, MWExceptionRenderer::AS_PRETTY ); + if ( $e instanceof MWException ) { + // Delegate to MWException until all subclasses are handled by + // MWExceptionRenderer and MWException::report() has been + // removed. + $e->report(); + } else { + MWExceptionRenderer::output( + $e, MWExceptionRenderer::AS_PRETTY ); + } } catch ( Exception $e2 ) { // Exception occurred from within exception handler // Show a simpler message for the original exception,